using System.ComponentModel.Design;

namespace CSharpPro._1106;

public class Demo
{
    //测试泛型
//1，定义泛型,参考Stack类
//2，泛型限制,参考Stack类
//3，泛型继承,参考Child类
//4，泛型中定义方法并使用,参考Dictionary
    public void Test1()
    {
        List<User> users = new List<User>();
        Stack<User> stack = new Stack<User>();
        /*Student没有空参构造方法，所以不能将Studnet给泛型T
        Stack<Student> stack2 = new Stack<Student>();*/
        //使用Dictionary
        System.Collections.Generic.Dictionary<String,Object> userDict = new System.Collections.Generic.Dictionary<String,Object>();
        userDict.Add("name","John");
        userDict.Add("age","25");
        userDict.Add("code",200);
        Console.WriteLine(userDict);
    }

    public void Test2()
    {
        UserService userService = new UserServiceImpl();
        userService.Menu();
    }
}